import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import Util from '@/utils'
// 引入自定义指令
import '@/utils/directives.js'
import 'ant-design-vue/dist/antd.css'
import '@/utils/antdesign'
import Antd from 'ant-design-vue'
import i18n from '@/lang'
import store from './store'
import dayjs from 'dayjs'

// svg
import 'virtual:svg-icons-register'
// vconsole
import Vconsole from 'vconsole'
// 如果为测试环境
if (import.meta.env.VITE_NODE_ENV !== 'production' && store.state.app.isMobile) {
	new Vconsole()
}
// 权限文件
import './permission'

// 音乐播放
const audioManager = {
	audioPlayer: null,
	isPlaying: false,
}
Vue.prototype.$Util = Util
Vue.prototype.$store = store
Vue.prototype.$dayjs = dayjs
Vue.use(Antd)
new Vue({
	i18n,
	router,
	store,
	provide: {
		audioManager, // 提供音频管理器给所有子组件
	},
	render: h => h(App),
}).$mount('#app')
